package config

import (
	swagger "github.com/arsmn/fiber-swagger/v2"
	_ "github.com/cyfqyb/fiber_demo/docs"
	"github.com/gofiber/fiber/v2"
	"github.com/gofiber/fiber/v2/log"
)

func init() {
	RegisterConfigsInitializer(InitSwag)
}

func InitSwag(app *fiber.App) {
	app.Get("/docs/*", swagger.HandlerDefault)
	app.Get("/docs/*", swagger.New(swagger.Config{
		URL: "http://localhost:8080/swagger/doc.json",
	}))
	log.Info("swagger init success")
}
